{% extends 'base.html' %}

{% block title %}
    登录
{% endblock %}
{% block carousel %}

{% endblock %}
{% block head %}
{% endblock %}

{% block main %}
    <h3 class="title">图书商城</h3>
    <div class="container container35">
        <form class="form-horizontal" method="post">
            {{ form.csrf_token }}
            <div class="form-group">
                {{ form.username(class="form-control") }}
                {% if form.username.errors %}
                    <ul class=errors>
                        {% for error in form.username.errors %}
                            <li>{{ error }}</li>
                        {% endfor %}
                    </ul>
                {% endif %}
            </div>
            <div class="form-group">
                {{ form.password(class="form-control") }}
                {% if form.password.errors %}
                    <ul class=errors>
                        {% for error in form.password.errors %}
                            <li>{{ error }}</li>
                        {% endfor %}
                    </ul>
                {% endif %}
            </div>
            <div class="form-group">
                {{ form.submit(class='btn btn-primary btn-block') }}
            </div>
            {#            <div class="form-group">#}
            {#                <input name="username" type="text" class="form-control" placeholder="用户名">#}
            {#            </div>#}
            {#            <div class="form-group">#}
            {#                <input name="password" type="password" class="form-control" placeholder="密码">#}
            {#            </div>#}
            {#            <div class="form-group">#}
            {#                <button type="submit" class="btn btn-primary btn-block">登录</button>#}
            {#            </div>#}
        </form>
        <a class="pull-right" href="{{ url_for('register') }}">还没有账号？注册一个</a>
    </div>
{% endblock %}